package com.mapper;

import com.pojo.Teacher_db;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface TeacherMapper_db {

    List<Teacher_db> list(@Param("name") String name,@Param("del") Integer del);

    @Select("select * from teacher_db where t_del = 1")
    List<Teacher_db> listAll();

    @Select("select * from teacher_db where t_id = #{id}")
    Teacher_db findById(Integer id);

    @Insert("insert into teacher_db(t_name,t_level,t_tupian,t_address,t_jianjie,t_talk,t_text,t_lingyu,t_sex,t_niandai,t_shanchang,t_del) values(#{tName},#{tLevel},#{tTupian},#{tAddress},#{tJianjie},#{tTalk},#{tText},#{tLingyu},#{tSex},#{tNiandai},#{tShanchang},#{tDel})")
    Integer add(Teacher_db teacherDb);

    @Update("update teacher_db set t_name = #{tName},t_level = #{tLevel},t_tupian = #{tTupian},t_address = #{tAddress},t_jianjie = #{tJianjie},t_talk = #{tTalk},t_text = #{tText},t_lingyu = #{tLingyu},t_sex = #{tSex},t_niandai = #{tNiandai},t_shanchang = #{tShanchang},t_del = #{tDel} where t_id = #{tId}")
    Integer update(Teacher_db teacherDb);

    @Update("update teacher_db set t_del = #{del} where t_id = #{id}")
    Integer updateDel(@Param("del") Integer tDel,@Param("id") Integer tId);

    @Delete("delete from teacher_db where t_id = #{tId}")
    Integer del(Integer tId);
}
